package com.eastech.cargame.admin.controller;


import cn.foolishbird.hamal.frame.base.Rst;
import cn.foolishbird.hamal.frame.base.RstFactory;
import cn.foolishbird.hamal.frame.exception.base.BaseException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import cn.foolishbird.hamal.frame.sys.entity.SysUser;
import cn.foolishbird.hamal.frame.sys.service.ISysUserService;
import cn.foolishbird.hamal.frame.base.CustomBaseController;
import springfox.documentation.annotations.ApiIgnore;

/**
* <p>
*  前端控制器
* </p>
*
* @author Eric
* @since 2020-10-13
*/
@RestController
@Api(value = "系统用户接口", tags = {"系统用户接口"})
@RequestMapping("/sysUser")
public class SysUserController extends CustomBaseController<SysUser, ISysUserService> {

//    @PostMapping(value = "/login")
//    @ApiOperation(value = "登录", notes = "登录")
//    public Rst<TokenDTO> login(
//            @ApiParam(name = "username", value = "用户名", required = true) @RequestParam(name = "username") String username,
//            @ApiParam(name = "password", required = true) @RequestParam(name = "password") String password,
//            @ApiParam(name = "verifyCodeKey", required = true) @RequestParam(name = "verifyCodeKey") String verifyCodeKey,
//            @ApiParam(name = "verifyCode", required = true) @RequestParam(name = "verifyCode") String verifyCode
//    ) throws BaseException {
//        return RstFactory.success(service.login(username, password, verifyCodeKey, verifyCode));
//    }
//
//    @PostMapping(value = "/logout")
//    @ApiOperation(value = "退出", notes = "退出登录")
//    public Rst<Boolean> logout(
//            @ApiIgnore @RequestHeader Long sysUserId
//    ) throws BaseException {
//        return RstFactory.success(service.logout(sysUserId));
//    }
//
//    @PostMapping(value = "/obtainUserSysInfo")
//    @ApiOperation(value = "获取用户信息", notes = "获取用户信息")
//    public Rst<SysUserInfoVO> obtainUserSysInfo(
//            @ApiIgnore @RequestHeader Long sysUserId
//    ) throws BaseException {
//        return RstFactory.success(service.obtainUserSysInfo(sysUserId));
//    }
//
//    @PostMapping(value = "/modifyPassword")
//    @ApiOperation(value = "修改用户密码", notes = "修改用户密码")
//    public Rst<Boolean> modifyPassword(
//            @ApiIgnore @RequestHeader Long sysUserId,
//            @ApiParam(name = "oldPassword", required = true) @RequestParam(name = "oldPassword") String oldPassword,
//            @ApiParam(name = "newPassword", required = true) @RequestParam(name = "newPassword") String newPassword
//    ) throws BaseException {
//        return RstFactory.success(service.modifyPassword(sysUserId, oldPassword, newPassword));
//    }
//
//    @PostMapping(value = "/authorization")
//    @ApiOperation(value = "用户授权角色", notes = "用户授权角色")
//    public Rst<Boolean> authorization(
//            @ApiParam(name = "userId", value = "系统用户id", required = true) @RequestParam(name = "userId") Long userId,
//            @ApiParam(name = "roleId", value = "用户菜单id", required = true) @RequestParam(name = "roleId") Long roleId,
//            @ApiParam(name = "authorization", value = "是否授权", required = true) @RequestParam(name = "authorization") Boolean authorization
//    ) throws BaseException {
//        return RstFactory.success(service.authorization(userId, roleId, authorization));
//    }

}
